import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
import List from '@/views/List'
import News from '@/views/News'
import User from '@/views/User'
import Index from '@/views/Homeh'
import City from '@/views/City'
import Map from '@/views/Map'
import Add from '@/views/Rent/add.vue'
import search from '@/views/Rent/search.vue'
import Detail from '@/views/Detail'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/home/home'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/city',
    component: City
  },
  {
    path: '/map',
    component: Map
  },
  {
    path: '/detail',
    component: Detail
  },
  {
    path: '/rent/add',
    component: Add
  },
  {
    path: '/rent/search',
    component: search
  },
  {
    path: '/home',
    component: Home,
    redirect: '/home/home',
    children: [
      {
        path: 'list',
        component: List
      },
      {
        path: 'news',
        component: News
      },
      {
        path: 'profile',
        component: User
      },
      {
        path: 'home',
        component: Index
      }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
